<!--#INCLUDE FILE="conn.asp"-->
<!--#INCLUDE FILE="ad_function.asp"-->
<!-- #include file="aFunction_charCode.asp" -->
<!-- #include file="ad_comSub.asp" -->

<%
Call tslt_useridentity12_error_end()
%>

<HTML>
<HEAD>
<TITLE></TITLE>
<link href=../style/<%=session("tslt_stylefolder")%>/admin.css rel="stylesheet" type="text/css">
       <SCRIPT language=JavaScript>
       <!--
             function go(src,q)
             {
                  var ret;
                  ret = confirm(q);
                  if(ret!=false)window.location=src;
             }
        -->
        </SCRIPT>
</HEAD>
<BODY bgcolor=#aaaac4>
<CENTER>
<br>
<table><tr><td class="font2">û</td></tr></table>
<hr width="700">
<br>

<%
if request.QueryString("User")<>""  then
        call deluser_article(request.QueryString("User"))
        Call infoDivShow("&nbsp;ɾɹ")
        Response.write"<META HTTP-EQUIV='Refresh' content='2; URL=manageuser.asp'>"
end if
if request.QueryString("User")=""  then
        if request.QueryString("Id")<>""  then
               call deluser_article2(request.QueryString("ID"))
               Call infoDivShow("&nbsp;ɾɹ")
               Response.write"<META HTTP-EQUIV='Refresh' content='2; URL=manageuser.asp'>"
       end if
end if
%>

<table border=1 width=700 bgcolor=#dedfde cellpadding="5" cellspacing="15">
    <tr>
         <td align=center>
               <TABLE border="0" width="100%" cellspacing="1" cellpadding="0" >
                     <tr>
                            <td  class=td align="center" height="15" width="10%"><font color="#FF0000">&nbsp;</font></td>
                            <td  class=td align="center" height="15" width="10%"><font color="#FF0000">&nbsp;</font></td>
                            <td  class=td align="center" height="15" width="40%"><font color="#FF0000">&nbsp;&nbsp;&nbsp; </font></td>
                            <td  class=td align="center" height="15" width="20%"><font color="#FF0000">(û)</font></td>
                            <td  class=td align="center" height="15" width="20%"><font color="#FF0000">ʱ</font></td>
                      </tr>
<%
                      Dim  objRS,strSQL
                      keyword2=trim(request("keyword"))
                      if keyword2<>"" then
                            strSQL = "SELECT * FROM article where (user like '%"& keyword2 &"%') or (subject like '%"& keyword2 &"%') Order By ID DESc"
                      else
                             strSQL = "SELECT * FROM article Order By ID DESc"
                      end if
                      Set objRS = Server.CreateObject("ADODB.Recordset")
                      objRS.Open strSQL, Conn, 1, 2
                            If objRS.Eof And objRS.Bof Then
                                   Response.Write "<SCRIPT language=Javascript>passwords(promptInfo_manageuser(2))</SCRIPT>"
                                   Response.write"<META HTTP-EQUIV='Refresh' content='3; URL=" &Request.ServerVariables("HTTP_REFERER")& "'>"
                            Else
                                   Dim totalPage,totalRecordcount
                                   objrs.PageSize = showlistok()
                                   totalPage=objrs.pagecount 
                                   objRS.AbsolutePage=REQUEST("Page")
                                   totalRecordcount = objrs.recordcount
                                   If Request("Page")<> "" Then   
                                          ShowPage objRS, Request("Page")
                                   Else  
                                          ShowPage objRS, 1  
                                   End If  
                            End If
                     objRS.Close
                     Set objRS = Nothing
%>
             </TABLE>

             <br>
             <TABLE width="100%" border="1" style="background-color:#ffffff">
                <TR><TD>
                           <%call pages()%>
                 </TD></TR>
             </TABLE>
        </td>
    </tr>
</table>

<%
 response.write "<br>"
 response.write "<table width=570 height=35 border=1 cellspacing=0 cellpadding=2 align=center><tbody><tr bordercolor=#0099CC align=center>"&_ 
 "<form name=search action=manageuser.asp method=post><td bgcolor=LightBlue align=right  width=40%/><p style='font-size:20;color:#000070'>:</p></td>"&_
 "<td bgcolor=LightBlue width=30%/><input type=text name=keyword maxlength=50 value=" &keyword2& "></td>"&_
 " <td bgcolor=LightBlue align=left><input type=submit height=18 width=39  name=b2 alt= value=></td>"&_
 "<td>&nbsp;&nbsp;<a href=javascript:history.go(-1)>ǰҳ</a></td>"&_
 "</tr></tbody></form></table>"
%>

</CENTER> 
</BODY>
</HTML>

<%
Call conn_Nothing()

Sub ShowPage(objRS, Page)
        For I = 1 To objRS.PageSize
              Response.Write "<TR height='20'>"
%>
              <%if objRS("User")<>"" then%> 
                     <td class=td1 align='center'><a class=a1 href="javascript:go('manageuser.asp?User=<%=objrs("User")%>&Id=<%=objrs("ID")%>','ؾ棡ɾû &nbsp;(<%=objrs("User")%>)&nbsp; (̶̶̶ܹͷʾ)ע⣺ɾĲǱƪ£Ǹûȫֻɾƪ£뷵ǰ̨ûҳȷҪɾ?')" title="ȫɾ">ɾ</a></td>
              <%else%>
                     <td class=td1 align='center'><a class=a1 href="javascript:go('manageuser.asp?User=<%=objrs("User")%>&Id=<%=objrs("ID")%>','棡ɾ&nbsp;ο&nbsp;(̶̶̶ܹͷʾ),ȷҪɾ?')" title="ȫɾ">ɾ</a></td>
              <%end if%>
<%
              Response.Write "<td class=td1 align='center'><font size=2>"& objRS("id") &"</td>"
              Response.Write "<td class=td1 align='left'><font face= size=4><b>"
              if objrs("secret") then response.write"<font color=bbbbbb>" 
              if objrs("adminindex")=true then  response.Write"<img src='../images/02.gif' alt='̶ܹ' width='17' height='17' border=0>"
              if objrs("topfirst")=true then  response.Write"<img src='../images/topimg.gif' alt='̶' width='17' height='17' border=0>"
              if objrs("top1")=true then  response.Write"<img src='../images/top1img.gif' alt='̶' width='17' height='17' border=0>"
              if objrs("jinghua") then response.Write"<img src='../images/jh.gif' alt='' width='17' height='17' border=0>"
              if objrs("board_bulletin") then response.Write"<img src='../images/star.GIF' alt='ͷʾ' width='17' height='17' border=0>"
              if objrs("lockarticle") then
                     response.Write"<img src='../images/lock.gif' alt='' width='17' height='17' border=0>"
              end if
              if objrs("transmit") then
                     response.Write"<img src='../images/transmit.gif' alt='ת' width='17' height='17' border=0>"
              end if
              if len(objrs("subject"))>10 then
                     response.write "<a title='"&objrs("subject")& "'>" &(left(objrs("subject"),10))& "...</a>" 
              else 
                     response.write "<a title='" &objrs("subject")& "'>" &objrs("subject")& "</a>" 
              end if 
              Response.Write"</b></font>"
              Response.Write "</td>"
              Response.Write "<td class=td1 align='center'><font size=2>"
             if objRS("User")<>"" then
                         call userStanding(objRS("User")) 
                         call UserInfoLink(objRS("User"))
             else
                    Response.Write "(ο)"
             end if
             Response.Write "<td class=td1 align='center'><font size=2>" & objRS("AddTime") & "</td>"
             Response.Write "</TR>"
             Response.Write "<TR height='6' bgcolor='#fffff8'><td colspan='6'></TR>"
             objRS.MoveNext
             If objRS.EOF Then Exit For 
       Next    
End Sub

sub pages()
        dim Page      
        Page = Request("Page")
        if Page="" or Page=0 then
                 page=1
        else
                 page=cint(request("page"))
        end if
       if totalRecordcount<>0 then
            dim currid1,currid2
            if totalPage>=10 then
                  if Page mod 10=0 then
                        currid1=Page
                        currid2=Page-9
                  else
                        if totalPage mod 10=0 then 
                               currid1=int(Page/10)*10+10
                        else 
                               if int(Page/10)=int(totalPage/10) then currid1=(totalPage/10)*10 else currid1=int(Page/10)*10+10
                        end if
                        currid2=int(Page/10)*10+1
                  end if
            else 
                  currid1=totalPage mod 10
                  currid2=int(totalPage/10)*10+1
            end if
%>
            <table align=left>
                 <tr><td>
<%
                        if totalPage>1 Then
                              If Page=totalPage or Page<>1 Then 
                                     dim PrwePage
                                     PrwePage=Page-1
                                     Response.Write "<A class=a1 HREF=manageuser.asp?Page="&PrwePage&"&keyword="&keyword2&"&sel1="&request("sel1")   
                                     Response.Write "><font size=4>һҳ</font></A>  "              
                              End If  
                        End If          
%>
                 </td></tr>
            </table>
            <table border="0" align="left">
                 <tr><td>
                       <FONT face=webdings size=2>
                       <%if Page=1 then%>
                               <span style="color: #FF0000">9</span>
                       <%else%>
                               <a class=a2 href="manageuser.asp?Page=1<%="&keyword="&keyword2&"&sel1="&request("sel1")%>">9</a>
                       <%end if%>
                       <%if Page>10 then%>
                               <a class=a2 href="manageuser.asp?Page=<%=currid2-1&"&keyword="&keyword2&"&sel1="&request("sel1")%>">7</a>
                       <%end if%>
                       </FONT>
                       <strong>
<%
                       for i=currid2 to currid1
                            if Page=i then 
	                             response.Write("<font color=red size=4>"&i&"</font>  ")
                            else
%>
                                 <FONT size=2>
                                 <a class=a2 href="manageuser.asp?Page=<%=i&"&keyword="&keyword2&"&sel1="&request("sel1")%>">
                                        <%response.write i%>
                                 </a>
                                 </FONT>
                            <%end if%>
                            <%response.write " "%>
                       <%next%>
                       </strong>
                       <FONT face=webdings size=2>
                       <%if currid1<totalPage then%>
                             <a class=a2 href="manageuser.asp?Page=<%=currid1+1&"&keyword="&keyword2&"&sel1="&request("sel1")%>">8</a>
                      <%end if%>
                      </FONT> 
                      <FONT face=webdings size=2>
                      <%if Page=totalPage then%>
                             <span style="color: #FF0000">:</span>
                      <%else%>
                             <a class=a2 href="manageuser.asp?Page=<%=totalPage&"&keyword="&keyword2&"&sel1="&request("sel1")%>">:</a>
                      <%end if%>
                      </FONT>
                 </td></tr>
            </table>
            <table align=left>
                 <tr><td>
<% 
                        if totalPage>1 Then
                             If page=1 or totalPage>Page Then
                                   dim NextPage
                                   NextPage=Page+1
                                   Response.Write "<A  class=a1 HREF=manageuser.asp?Page="&NextPage&"&keyword="&keyword2&"&sel1="&request("sel1")
                                   Response.Write "><font size=4>һҳ</font></A>"
                             End If
                        End If
%>
                 </td></tr>
            </table>

            <table align=right>
                 <tr><td>
<%
                       if Page>totalPage then
                            Page=totalPage
                       end if
                      Response.Write "<font size=2>ҳΣ<font color= red><b>"& Page &"</b></font>/<b>"& totalPage &"</b>ҳ ,<b>"& totalRecordcount &"</b></font>"
%>
                </td></tr>
            </table>
<%
        end if
end Sub

sub deluser_article(aa)
     dim sql
     dim rs
     set rs=server.createobject("adodb.recordset")
     sql = "select * FROM article WHERE (User='" & aa & "' and jinghua = false and top1 = false and topfirst=false and adminindex=false and board_bulletin=false) Order By id DESc"
     rs.Open sql,conn,1,2
          do while not rs.eof
                set Rs1=server.createobject("adodb.recordset")
                Sql1 = "SELECT d_SavePathFileName FROM article WHERE id = " & rs("id")   
                Rs1.Open Sql1, Conn, 0, 1
                        Dim d_SavePathFileName2
                        If Not Rs1.Eof Then
                              d_SavePathFileName2 = Rs1("d_SavePathFileName")
                        End If
                        Dim aSavePathFileName
                        aSavePathFileName = Split(d_SavePathFileName2, "|")
                        Dim i
                        For i = 0 To UBound(aSavePathFileName)
                               Call DoDelFile(aSavePathFileName(i))
                        Next
                Rs1.close
                set Rs1=nothing
                rs.movenext
            loop 
       rs.close
       set rs=nothing

       set rs=server.createobject("adodb.recordset")
       sql = "select * FROM article WHERE User='" & aa & "'  and jinghua = false and top1 = false and topfirst=false and adminindex=false and board_bulletin=false Order By id DESc"
       rs.Open sql,conn,1,2
                  do while not rs.eof
                        set Rs2=server.createobject("adodb.recordset")
                        Sql2 = "SELECT r_SavePathFileName FROM reply WHERE cstr(reply_id)= " & rs("id")
                        Rs2.Open Sql2, Conn, 0, 1
                                do while not rs2.eof
                                      Dim r_SavePathFileName2
                                      If Not Rs2.Eof Then
                                             r_SavePathFileName2 = Rs2("r_SavePathFileName")
                                      End If
                                      Dim bSavePathFileName
                                      bSavePathFileName = Split(r_SavePathFileName2, "|")
                                      Dim j
                                      For j = 0 To UBound(bSavePathFileName)
                                             Call DoDelFile(bSavePathFileName(j))
                                       Next
                                       RS2.movenext
                                loop
                        RS2.close
                        Set RS2 = Nothing
                        rs.movenext
                   loop
       rs.close
       set rs=nothing
      set rs=server.createobject("adodb.recordset")
      sql = "select * FROM article WHERE User='" & aa & "'  and jinghua = false and top1 = false and topfirst=false and adminindex=false and board_bulletin=false Order By id DESc"
      rs.Open sql,conn,1,2
             For i = 1 To RS.recordcount
                     conn.execute("delete FROM reply WHERE cstr(reply_id)='" & rs("id") & "'")
                     RS.MoveNext
             Next
            conn.execute("delete FROM article WHERE User='" & aa & "'  and jinghua = false and top1 = false and topfirst=false and adminindex=false and board_bulletin=false")
       rs.close
       set rs=nothing
end sub

sub deluser_article2(aaa)
     dim sql
     dim rs
     set rs=server.createobject("adodb.recordset")
     sql = "select * FROM article WHERE (cstr(ID)='" & aaa & "' and jinghua = false and top1 = false and topfirst=false and adminindex=false and board_bulletin=false) Order By id DESc"
     rs.Open sql,conn,1,2
          do while not rs.eof
                set Rs1=server.createobject("adodb.recordset")
                Sql1 = "SELECT d_SavePathFileName FROM article WHERE id = " & rs("id")   
                Rs1.Open Sql1, Conn, 0, 1
                        Dim d_SavePathFileName2
                        If Not Rs1.Eof Then
                              d_SavePathFileName2 = Rs1("d_SavePathFileName")
                        End If
                        Dim aSavePathFileName
                        aSavePathFileName = Split(d_SavePathFileName2, "|")
                        Dim i
                        For i = 0 To UBound(aSavePathFileName)
                               Call DoDelFile(aSavePathFileName(i))
                        Next
                Rs1.close
                set Rs1=nothing
                rs.movenext
            loop 
       rs.close
       set rs=nothing

       set rs=server.createobject("adodb.recordset")
       sql = "select * FROM article WHERE cstr(ID)='" & aaa & "'  and jinghua = false and top1 = false and topfirst=false and adminindex=false and board_bulletin=false and board_bulletin=false Order By id DESc"
       rs.Open sql,conn,1,2
                  do while not rs.eof
                        set Rs2=server.createobject("adodb.recordset")
                        Sql2 = "SELECT r_SavePathFileName FROM reply WHERE cstr(reply_id)= " & rs("id")
                        Rs2.Open Sql2, Conn, 0, 1
                                do while not rs2.eof
                                      Dim r_SavePathFileName2
                                      If Not Rs2.Eof Then
                                             r_SavePathFileName2 = Rs2("r_SavePathFileName")
                                      End If
                                      Dim bSavePathFileName
                                      bSavePathFileName = Split(r_SavePathFileName2, "|")
                                      Dim j
                                      For j = 0 To UBound(bSavePathFileName)
                                             Call DoDelFile(bSavePathFileName(j))
                                       Next
                                       RS2.movenext
                                loop
                        RS2.close
                        Set RS2 = Nothing
                        rs.movenext
                   loop
       rs.close
       set rs=nothing
      set rs=server.createobject("adodb.recordset")
      sql = "select * FROM article WHERE cstr(ID)='" & aaa & "'  and jinghua = false and top1 = false and topfirst=false and adminindex=false and board_bulletin=false Order By id DESc"
      rs.Open sql,conn,1,2
             For i = 1 To RS.recordcount
                     conn.execute("delete FROM reply WHERE cstr(reply_id)='" & rs("id") & "'")
                     RS.MoveNext
             Next
            conn.execute("delete FROM article WHERE cstr(ID)='" & aaa & "'  and jinghua = false and top1 = false and topfirst=false and adminindex=false and board_bulletin=false")
       rs.close
       set rs=nothing
end sub

%>
